require("../../../common/manifest.js"), require("../../../common/vendor.js"), global.webpackJsonpMpvue([ 5 ], {
    UEcR: function(t, e, a) {
        Object.defineProperty(e, "__esModule", {
            value: !0
        });
        var i = a("5nAL"), s = a.n(i), n = a("lmdi");
        new s.a(n.a).$mount();
    },
    Vagp: function(t, e, a) {
        (function(t) {
            e.a = {
                data: function() {
                    return {
                        mode: "aspectFill",
                        currentIndex: "",
                        current: "",
                        duration: 0,
                        wallpaperArr: [],
                        wallpaperUrl: "",
                        wallpaperId: "",
                        isConnected: !0,
                        isEnter: !1,
                        cateId: "",
                        key: "",
                        page: "",
                        isMax: !1,
                        tag: "",
                        isHome: !1,
                        isFit: !1
                    };
                },
                onLoad: function(e) {
                    var a = null;
                    wx.createInterstitialAd && ((a = wx.createInterstitialAd({
                        adUnitId: "adunit-13934bc1d3a77a93"
                    })).onLoad(function() {}), a.onError(function(t) {}), a.onClose(function() {})), 
                    a && a.show().catch(function(t) {
                        console.error(t);
                    });
                    var i = this;
                    if (this.isEnter = !0, this.isHome = !1, t.mpvue.setNavigationBarTitle({
                        title: "壁纸详情"
                    }), this.current = this.currentIndex = "", this.duration = 0, this.tag = e.tag, 
                    "share" === this.tag) return this.isHome = !0, this.wallpaperUrl = e.file, void (this.wallpaperId = e.id);
                    if ("mx" === this.tag) return this.isHome = !0, this.wallpaperUrl = "http://" + e.file, 
                    void (this.wallpaperId = e.id);
                    var s = parseInt(e.index);
                    this.page = e.page, "result" !== this.tag && "bg" !== this.tag || (this.cateId = e.cateId), 
                    "search" === this.tag && (this.key = e.key), t.mpvue.getStorage({
                        key: "wallpaperArr",
                        success: function(t) {
                            if (i.wallpaperArr = t.data, 0 !== s) {
                                var e = [].concat(i.wallpaperArr[s]);
                                i.wallpaperArr = e.concat(i.wallpaperArr), i.currentIndex = i.current = s + 1;
                            } else i.currentIndex = i.current = s;
                            i.duration = 500;
                        }
                    });
                },
                onShow: function() {
                    var e = this;
                    4 === this.globalData.scene && (this.globalData.isScene = !0), this.globalData.scene = 1, 
                    this.isFit || t.mpvue.getSystemInfo({
                        success: function(t) {
                            Boolean(t.model.match(/iphone X/gi)) && (e.isFit = !0);
                        }
                    });
                },
                onHide: function() {
                    this.globalData.scene = 4;
                },
                mounted: function() {
                    var e = this;
                    t.mpvue.onNetworkStatusChange(function(t) {
                        e.isConnected = t.isConnected;
                    });
                },
                onShareAppMessage: function() {
                    var t = "share" === this.tag ? this.wallpaperUrl + ".jpg" : this.wallpaperArr[this.current].preview + ".jpg";
                    this.currentIndex = this.current;
                    var e = this.globalData.shareArr;
                    return {
                        title: e[Math.floor(Math.random() * e.length)],
                        path: "/pages/main/details/main?tag=share&file=" + t + "&id=" + this.wallpaperArr[this.current].id,
                        imageUrl: t
                    };
                },
                methods: {
                    handleChange: function(t) {
                        if (this.current = t.mp.detail.current, "share" !== this.tag && t.mp.detail.current === this.wallpaperArr.length - 1) {
                            if ("result" === this.tag) return void this.getList();
                            "bg" === this.tag && this.getBgList(), this.getSearchList();
                        }
                    },
                    goMain: function() {
                        t.mpvue.redirectTo({
                            url: "/pages/main/index/main"
                        });
                    },
                    getPermiss: function() {
                        var e = this;
                        t.mpvue.getSetting({
                            success: function(a) {
                                !1 === a.authSetting["scope.writePhotosAlbum"] ? t.mpvue.openSetting({
                                    success: function(t) {}
                                }) : e.downAvatar();
                            }
                        });
                    },
                    confirmPic: function() {
                        return "result" === this.tag || "main" === this.tag || "search" === this.tag ? {
                            file: this.wallpaperArr[this.current].preview,
                            id: this.wallpaperArr[this.current].id
                        } : "bg" === this.tag ? {
                            file: this.wallpaperArr[this.current].raw.url,
                            id: this.wallpaperArr[this.current].id
                        } : {
                            file: this.wallpaperUrl,
                            id: this.wallpaperId
                        };
                    },
                    downAvatar: function() {
                        var e = this.confirmPic().file, a = this.confirmPic().id, i = (new Date().getTime(), 
                        new Date().valueOf()), s = wx.env.USER_DATA_PATH + "/" + i + ".jpg";
                        console.log(s), t.mpvue.downloadFile({
                            url: "https://news.moxiu.com/applets/wallpaper/download?file=" + e + "&id=" + a + "&name=" + i + ".jpg",
                            filePath: s,
                            success: function(e) {
                                200 === e.statusCode && t.mpvue.saveImageToPhotosAlbum({
                                    filePath: s,
                                    success: function(e) {
                                        t.mpvue.showToast({
                                            title: "保存成功啦~",
                                            icon: "success",
                                            duration: 1e3
                                        });
                                    }
                                });
                            }
                        });
                    },
                    getList: function() {
                        var e = this;
                        this.page++, this.isMax || t.mpvue.request({
                            url: "https://news.moxiu.com/applets/avatar/content",
                            method: "GET",
                            dataType: "json",
                            data: {
                                cateId: this.cateId,
                                page: this.page
                            },
                            header: {
                                "content-type": "application/json"
                            },
                            success: function(t) {
                                e.wallpaperArr = e.wallpaperArr.concat(t.data.data.list), e.page >= t.data.data.meta.pages && (e.isMax = !0);
                            },
                            fail: function(e) {
                                t.mpvue.showToast({
                                    title: "网络异常，请稍后再试",
                                    icon: "none"
                                });
                            }
                        });
                    },
                    getSearchList: function() {
                        var e = this;
                        this.page++, this.isMax || t.mpvue.request({
                            url: "https://news.moxiu.com/applets/wallpaper/search?q=" + this.key + "&page=" + this.page,
                            method: "POST",
                            dataType: "json",
                            header: {
                                "content-type": "application/json"
                            },
                            success: function(t) {
                                e.wallpaperArr = e.wallpaperArr.concat(t.data.data.list), e.page >= t.data.data.meta.pages && (e.isMax = !0);
                            },
                            fail: function(e) {
                                t.mpvue.showToast({
                                    title: "网络异常，请稍后再试",
                                    icon: "none"
                                });
                            }
                        });
                    },
                    getBgList: function() {
                        var e = this;
                        this.page++, this.isMax || t.mpvue.request({
                            url: "https://news.moxiu.com/applets/wallpaper/bGPic",
                            method: "GET",
                            dataType: "json",
                            data: {
                                cateId: this.cateId,
                                page: this.page
                            },
                            header: {
                                "content-type": "application/json"
                            },
                            success: function(t) {
                                e.wallpaperArr = e.wallpaperArr.concat(t.data.data.list), e.page >= t.data.data.meta.pages && (e.isMax = !0);
                            },
                            fail: function(e) {
                                t.mpvue.showToast({
                                    title: "网络异常，请稍后再试",
                                    icon: "none"
                                });
                            }
                        });
                    }
                }
            };
        }).call(e, a("DuR2"));
    },
    lmdi: function(t, e, a) {
        var i = a("Vagp"), s = a("rSGn"), n = a("ybqe")(i.a, s.a, function(t) {
            a("m3Vc");
        }, null, null);
        e.a = n.exports;
    },
    m3Vc: function(t, e) {},
    rSGn: function(t, e, a) {
        var i = {
            render: function() {
                var t = this, e = t.$createElement, a = t._self._c || e;
                return a("div", {
                    staticClass: "details-bg"
                }, [ a("div", {
                    directives: [ {
                        name: "show",
                        rawName: "v-show",
                        value: t.isConnected,
                        expression: "isConnected"
                    } ],
                    staticClass: "details-wrapper"
                }, [ "share" === t.tag || "mx" === t.tag ? a("img", {
                    staticClass: "wallpaper-detail",
                    attrs: {
                        src: t.wallpaperUrl,
                        mode: t.mode
                    }
                }) : a("swiper", {
                    staticClass: "swiper",
                    attrs: {
                        current: t.currentIndex,
                        duration: t.duration,
                        eventid: "0"
                    },
                    on: {
                        change: t.handleChange
                    }
                }, t._l(t.wallpaperArr, function(e, i) {
                    return a("div", [ a("swiper-item", {
                        staticClass: "swiper-item",
                        attrs: {
                            mpcomid: "0_" + i
                        }
                    }, [ "bg" !== t.tag ? a("img", {
                        staticClass: "wallpaper-detail",
                        attrs: {
                            src: e.preview,
                            mode: t.mode
                        }
                    }) : a("img", {
                        staticClass: "wallpaper-detail",
                        attrs: {
                            src: e.raw.url,
                            mode: t.mode
                        }
                    }) ]) ], 1);
                })), t._v(" "), a("div", {
                    staticClass: "btn-box",
                    class: {
                        "btn-box-active": t.isFit
                    }
                }, [ a("div", {
                    staticClass: "btn down-btn",
                    attrs: {
                        eventid: "1"
                    },
                    on: {
                        click: t.getPermiss
                    }
                }, [ a("img", {
                    staticClass: "icon",
                    attrs: {
                        src: "/static/images/wallpaper-down.png"
                    }
                }), t._v(" "), a("p", [ t._v("下载") ]) ], 1), t._v(" "), a("div", {
                    staticClass: "separate-box"
                }), t._v(" "), a("button", {
                    staticClass: "btn share-btn",
                    attrs: {
                        "open-type": "share"
                    }
                }, [ a("img", {
                    staticClass: "icon",
                    attrs: {
                        src: "/static/images/wallpaper-share.png"
                    }
                }), t._v(" "), a("div", {
                    staticClass: "down-content share-content"
                }, [ t._v("分享") ]) ]) ], 1), t._v(" "), a("img", {
                    directives: [ {
                        name: "show",
                        rawName: "v-show",
                        value: t.isHome,
                        expression: "isHome"
                    } ],
                    staticClass: "home-btn",
                    attrs: {
                        src: "/static/images/home.png",
                        eventid: "2"
                    },
                    on: {
                        click: t.goMain
                    }
                }) ], 1), t._v(" "), !t.isConnected && t.isEnter ? a("div", {
                    staticClass: "network-remind"
                }, [ a("img", {
                    staticClass: "remind-icon",
                    attrs: {
                        src: "/static/images/network-remind.png"
                    }
                }), t._v(" "), a("p", [ t._v("网络开小差了~ ") ]) ], 1) : t._e() ]);
            },
            staticRenderFns: []
        };
        e.a = i;
    }
}, [ "UEcR" ]);